﻿using CellarDoor.Gui.Elements;

namespace CellarDoor.Gui.Demo.DemoScreens
{
    public class DockScreen : BaseScreen
    {
        public DockScreen(UiManager manager)
            : base(manager)
        {
            Initialize();
        }

        private void Initialize()
        {
            var dock = new UiPanel(Panel);
            dock.Width = Panel.Width;
            dock.Height = Panel.Height - 45;
            dock.ElementName = "";

            int padding = 0;
            int margin = 0;

            var p = new UiPanel(dock);
            p.Dock = UiDockStyles.Top;
            p.Height = 50;
            p.Width = 50;
            p.Padding = new UiPadding(padding);
            p.Margin = new UiPadding(margin);
            p.Text = p.Dock.ToString();

            p = new UiPanel(dock);
            p.Dock = UiDockStyles.Right;
            p.Height = 50;
            p.Width = 50;
            p.Padding = new UiPadding(padding);
            p.Margin = new UiPadding(margin);
            p.Text = p.Dock.ToString();

            p = new UiPanel(dock);
            p.Dock = UiDockStyles.Bottom;
            p.Height = 50;
            p.Width = 50;
            p.Padding = new UiPadding(padding);
            p.Margin = new UiPadding(margin);
            p.Text = p.Dock.ToString();

            p = new UiPanel(dock);
            p.Dock = UiDockStyles.Left;
            p.Height = 50;
            p.Width = 50;
            p.Padding = new UiPadding(padding);
            p.Margin = new UiPadding(margin);
            p.Text = p.Dock.ToString();

            p = new UiPanel(dock);
            p.Dock = UiDockStyles.Fill;
            p.Height = 50;
            p.Width = 50;
            p.Padding = new UiPadding(padding);
            p.Margin = new UiPadding(10);
            p.Text = p.Dock.ToString();

            //
            // multiple items that are docked with fill mode are currently not supported
            //

            //p = new UiPanel(dock);
            //p.Dock = UiDockStyles.Fill;
            //p.Height = 50;
            //p.Width = 50;
            //p.Padding = new UiPadding(padding);
            //p.Margin = new UiPadding(margin);
        }
    }
}
